#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "set.h"

int main (int argc , char ** argv)
{
  int c;
  struct set * ensemble= set__empty();
  FILE  *  fichier=NULL;
  char * link = argv [1];
  if (argc == 2)
  {
    if ( (fichier = fopen( link  ,"r")) != NULL)
    {
      while((c = fgetc(fichier)) != EOF)
      {
        set__add(ensemble, c);
      } 
    }
    else
    {
      fprintf(stderr, "Fichier non ouvert. \n");
      exit(1);
    }
  }
  else 
  {
    fprintf(stderr, "Pas assez d'arguments. \n" );
    exit(1);
  }
  printf("%d \n", set__size(ensemble));
  return (set__size(ensemble));
}

